<?php
/**
 * @package      OWNServices
 * @subpackage   site
 *
 * @author       Sanawin Tinsuwan
 * @copyright    Copyright (C) 20014 Sanawin Tinsuwan. All rights reserved.
 * @license      http://www.gnu.org/licenses/gpl.html GNU/GPL, see LICENSE.txt
 */

defined('_JEXEC') or die();

/**
 * Bass controller class for OWNServices
 * @since 1.5
 */

class OWNServicesController extends JControllerLegacy
{
    /*
     * Method to display a view
     *
     * @param boolean   If true, the view output will be cached
     * @param array     an array of safe url parameters and their variables types, for valid values see {@link JFilterInput::clean()}.
     *
     * @return JController  The object to support hinning.
     * @since 1.5
     */

    public function display($cachable = false, $urlparams = false)
    {
        $vName  = $this->input->getCmd('view', 'ownservices');

        $urlparams = array(
            'id'               => 'INT',
            'cid'              => 'ARRAY',
            'limit'            => 'INT',
            'limitstart'       => 'INT',
            'showall'          => 'INT',
            'return'           => 'BASE64',
            'filter'           => 'STRING',
            'filter_order'     => 'CMD',
            'filter_order_Dir' => 'CMD',
            'filter_search'    => 'STRING',
            'filter_published' => 'CMD'
        );

        // Set the default view name and format from the Request.
        $this->input->set('view', $vName);

        //Set hide template of Joomla!
        $this->input->set('tmpl', 'component');

        // Display the view
        parent::display($cachable, $urlparams);

        // Return own instance for chaining
        return $this;
    }
}